# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Sylvain HENRY <hsyl20@yahoo.fr>

pkgname=opencl-headers
pkgver=2.2.20170516 
pkgrel=1
epoch=2
pkgdesc='OpenCL (Open Computing Language) header files'
arch=('any')
url='https://www.khronos.org/registry/cl/'
license=('custom')
makedepends=(git python)
source=('git+https://github.com/KhronosGroup/OpenCL-Headers.git#commit=ec2566b'
        'git+https://github.com/KhronosGroup/OpenCL-CLHPP.git#commit=e250e2e'
        'LICENSE.txt')
sha256sums=('SKIP'
            'SKIP'
            'd1059405dce021e0c0a7f7e01b48447e641477e0c14a9bc29983f4202b67c410')

package() {
  cd "${srcdir}"/OpenCL-Headers/opencl22/CL

  install -dm755 "${pkgdir}"/usr/include/CL

  for h in *.h; do
    install -m 644 ${h} "${pkgdir}"/usr/include/CL/
  done

  # remove useless headers
  rm "${pkgdir}"/usr/include/CL/{cl_d3d,cl_dx9}*.h

  cd "${srcdir}"/OpenCL-CLHPP

  python gen_cl_hpp.py -i input_cl.hpp -o cl.hpp
  install -m 644 cl.hpp "${pkgdir}"/usr/include/CL/
  install -m 644 input_cl2.hpp "${pkgdir}"/usr/include/CL/cl2.hpp

  install -D -m644 ../LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
